<?php
/* -------------------------------------------------------------------------------------
* 	ID:						$Id: ot_small_business.php 135 2013-09-22 07:30:55Z phone.mueller@googlemail.com $
* 	Letzter Stand:			$Revision: 135 $
* 	zuletzt geaendert von:	$Author: siekiera $
* 	Datum:					$Date: 2013-09-22 07:30:55 +0000 (Sun, 22 Sep 2013) $
*
* 	SEO:mercari by Siekiera Media
* 	http://www.seo-mercari.de
*
* 	Copyright (c) since 2011 SEO:mercari
* --------------------------------------------------------------------------------------
* 	based on:
* 	(c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
* 	(c) 2002-2003 osCommerce - www.oscommerce.com
* 	(c) 2003     nextcommerce - www.nextcommerce.org
* 	(c) 2005     xt:Commerce - www.xt-commerce.com
*
* 	Released under the GNU General Public License
* ----------------------------------------------------------------------------------- */

class ot_small_business {
    var $title, $output, $db;

    function __construct() {
		global $db;
		
		$this->code = 'ot_small_business';
		$this->title = MODULE_SMALL_BUSINESS_TITLE;
		$this->description = MODULE_SMALL_BUSINESS_DESCRIPTION;
		$this->enabled = ((MODULE_SMALL_BUSINESS_STATUS == 'true') ? true : false);
		$this->sort_order = MODULE_SMALL_BUSINESS_SORT_ORDER;
		$this->output = array();
		$this->db = $db;
    }

    function process() {
		$this->output[] = array('title' => USE_SMALL_BUSINESS_TEXT,
			                    'text' => '&nbsp;',
			                    'value' => 0);
    }

    function check() {
		if(!isset($this->_check)) {
			$check = $this->db->db_query("SELECT configuration_value from ".TABLE_CONFIGURATION." WHERE configuration_key = 'MODULE_SMALL_BUSINESS_STATUS'");
			$this->_check = $check->_numOfRows;
		}
		return $this->_check;
    }

    function keys() {
		return array('MODULE_SMALL_BUSINESS_STATUS', 'MODULE_SMALL_BUSINESS_SORT_ORDER');
    }

    function install() {
		$this->db->db_query("INSERT INTO ".TABLE_CONFIGURATION." (configuration_key, configuration_value, configuration_group_id, sort_order, set_function, date_added) VALUES ('MODULE_SMALL_BUSINESS_STATUS', 'true', '6', '1','cfg_select_option(array(\'true\', \'false\'), ', now())");
		$this->db->db_query("INSERT INTO ".TABLE_CONFIGURATION." (configuration_key, configuration_value, configuration_group_id, sort_order, date_added) VALUES ('MODULE_SMALL_BUSINESS_SORT_ORDER', '11', '6', '2', now())");
    }

	function remove() {
		$this->db->db_query("DELETE FROM ".TABLE_CONFIGURATION." WHERE configuration_key in ('".implode("', '", $this->keys())."')");
	}
}
?>